/A/Copy/H/CCCCC/Feature
If there is already a post for this, please refirect (as I could not find one during my search in this forum) HKrishnan - Mon Nov 23 04:49:16 EST 2015 |
Re: String Extraction Search the forum for "split string", you will probably find some example code. Regards, Mathias |
Re: String Extraction Mathias Mamsch - Mon Nov 23 04:56:21 EST 2015 Search the forum for "split string", you will probably find some example code. Regards, Mathias I Did some search and was able to get the attached example so I tried converting my script to address the requirement and am facing some errors. Anything missing ??
Regexp ProjectName = regexp("^(/([a-zA-Z])/([a-zA-Z])/([a-zA-Z])/([a-zA-Z])/([a-zA-Z])$")
bool ReadProjectName(string DecodeCR, &FirstSlash, &A, &SecondSlash, &Copy, &ThirdSlash, &H, &FourthSlash, &NAME, &FifthSlash, &Feature)
{
if (ProjectName DecodeCR)
{
FirstSlash = DecodeCR[match 1]
A = DecodeCR[match 2]
SecondSlash = DecodeCR[match 3]
Copy = DecodeCR[match 4]
ThirdSlash = DecodeCR[match 5]
H = DecodeCR[match 6]
FourthSlash = DecodeCR[match 7]
NAME = DecodeCR[match 8]
FifthSlash = DecodeCR[match 9]
Feature = DecodeCR[match 10]
return(true)
}
else
{
FirstSlash = ""
A = ""
SecondSlash = ""
Copy = ""
ThirdSlash = ""
H = ""
FourthSlash = ""
NAME = ""
FifthSlash = ""
Feature = ""
return(false)
}
}
void Test_ReadProjectName(string DecodeCR)
{
string FirstSlash, A, SecondSlash, Copy, ThirdSlash, H, FourthSlash, NAME, FifthSlash, Feature
bool Result = ReadProjectName(DecodeCR, FirstSlash, A, SecondSlash, Copy, ThirdSlash, H, FourthSlash, NAME, FifthSlash, Feature)
print Result "\t" NAME "\n"
}
Test_ReadProjectName("/A/Copy/H/CCCCC/Feature")
Attachments RegEx Example.dxl |
Re: String Extraction Thanks Mathias Mamsch
I was able to crack this by using us idea in the other thread
Created mention, continue typing for type aheadHere goes the code for the above requirement
Regexp re = regexp "/A/Copy/H/(.*)/Feature"
string s1 = "/A/Copy/H/CCCCC/Feature"
if (re s1 )
{
print s1[match 1] "\n"
}
|